package com.wanxi.springboot.team.manage.system.controller;


import com.wanxi.springboot.team.manage.system.api.CommonResult;
import com.wanxi.springboot.team.manage.system.mapper.SignMapper;
import com.wanxi.springboot.team.manage.system.service.SignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 蒋帆
 * @since 2020-12-21
 */
@RestController
@RequestMapping("/sign")
public class SignController {

    @Autowired
    SignService signService;

    @PreAuthorize("hasAnyAuthority('sign:record:add')")
    @PostMapping("/addSignRecords")
    public CommonResult addSignRecords(@RequestParam Map map){
        return signService.addSignRecords(map);
    }

    @PreAuthorize("hasAnyAuthority('sign:record:get')")
    @GetMapping("/getSignRecords")
    public CommonResult getSignRecords(){
        return signService.getSignRecords();
    }
}
